package com.motorola.accessories.provider;

import android.content.Context;
import android.database.SQLException;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
import android.util.Log;

public class DatabaseHelper extends SQLiteOpenHelper {

    private static final String TAG = "DatabaseHelper";
    private static int mDbVersion = 1;
    private static String mDbName = "accessories";
    private final static String CREATE_TABLE = "CREATE TABLE ";

    public DatabaseHelper(Context context) {
        super(context, mDbName, null, mDbVersion);
        // TODO Auto-generated constructor stub
    }

    @Override
    public void onCreate(SQLiteDatabase db) {
        // TODO Auto-generated method stub
        try {
            db.execSQL(CREATE_TABLE + ProviderInfo.TABLE_NAME + ProviderInfo.TABLE_COLUMNS_INFO);
        }catch (final SQLException e) {
            Log.w(TAG, "Accessories db can't be created!");
        }
    }

    @Override
    public void onUpgrade(SQLiteDatabase arg0, int arg1, int arg2) {
        // TODO Auto-generated method stub

    }

}
